package com.orange.lswidget;

import android.text.TextUtils;

public class LSWidgetTypeIniter {

	private static final String	TAG				= "LSWidgetTypeIniter";

	public static final String	WEATHER_CLASS	= "com.orange.lswidget.widgets.weather.WeatherWidget";
	public static final String	EVENT_CLASS		= "com.orange.lswidget.widgets.event.EventLSWidgetProvider";
	public static final String	MUSIC_CLASS		= "com.orange.lswidget.widgets.musicplayer.MusicLSWidgetProvider";
	public static final String	TIME_DATE_CLASS	= "com.orange.lswidget.widgets.timedate.TimeDateWidget";

	public static final int		TYPE_INVALID	= 0x000;
	public static final int		TYPE_WEATHER	= 0x100;
	public static final int		TYPE_MUSIC		= 0x101;
	public static final int		TYPE_EVENT		= 0x102;
	public static final int		TYPE_TIME_DATE	= 0x103;

	public static int getTypeByClassName(String cls) {
		int type = TYPE_INVALID;
		if (!TextUtils.isEmpty(cls)) {
			if (cls.equals(WEATHER_CLASS)) {
				type = TYPE_WEATHER;
			} else if (cls.equals(EVENT_CLASS)) {
				type = TYPE_EVENT;
			} else if (cls.equals(MUSIC_CLASS)) {
				type = TYPE_MUSIC;
			} else if (cls.equals(TIME_DATE_CLASS)) {
				type = TYPE_TIME_DATE;
			}
		}
		return type;
	}
}
